package com.ruoyi.odorservice.model.bean;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SiteMaterialConcentrationBean {

    @ApiModelProperty("点位名称")
    private String siteName;

    @ApiModelProperty("物质列表")
    private List<MaterialConcentration> materialList;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class MaterialConcentration{

        @ApiModelProperty("物质id")
        private Integer materialId;

        @ApiModelProperty("物质名称")
        private String materialName;

        @ApiModelProperty("浓度占比")
        private Double concentration;

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            MaterialConcentration that = (MaterialConcentration) o;
            return Objects.equals(materialId, that.materialId) &&
                    Objects.equals(materialName, that.materialName);
        }

        @Override
        public int hashCode() {
            return Objects.hash(materialId, materialName);
        }
    }

}
